﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp1 
{ 
//{分析：任务 NPC，商贩 NPC，铁匠 NPC，三种 NPC 的种类。
//共有属性：npc 的名字，npc 的类型；
//共有方法：都能和玩家交互(交谈)；

    abstract class NPC {

        private string npcname;
        private string workinfo;
        public string NpcName { get { return npcname; } set { this.npcname=value;} }
        public string Workinfo { get { return this.workinfo; } set { this.workinfo = value; } }
        public abstract void Speak();
        public NPC() { }
        public NPC(string name, string workinfo)
        {
            this.NpcName = name;
            this.Workinfo = workinfo;

        }

    }
    class Tesk : NPC {


        public override void Speak()
        {
            Console.WriteLine("我是{0},我有件重要的是需要你帮我去做:{1}",this.NpcName,this.Workinfo);
        }
    }
    class Shop : NPC
    {   public Shop() { }
        public Shop(string name, string workinfo) : base(name, workinfo)
        {
        }

        public override void Speak()
        {
            Console.WriteLine("我是{0},我这有:{1}，客官要不要买？", this.NpcName, this.Workinfo);
        }
    }
    class Ironsmith : NPC 
    {

        public Ironsmith() { }
        public Ironsmith(string name, string workinfo) : base(name, workinfo)
        {
        }
        public override void Speak()
        {
            Console.WriteLine("我是{0},{1}吗？", this.NpcName, this.Workinfo);
        }
    }
    class Program
    {
        static void Main(string[] args)
        {   //送信npc
            Tesk tesk1= new Tesk();
            tesk1.NpcName = "检察官";
            tesk1.Workinfo = "我有封信需要你帮忙送给罗法官";
            tesk1.Speak();
            //杀怪npc
            Tesk tesk2 = new Tesk();
            tesk2.NpcName = "白无常";
            tesk2.Workinfo = "丰都最近多了许多孤魂野鬼，恐其害人性命，我需要你去将那些人的鬼魂拘拿回地府";
            tesk2.Speak();
            //采集npc
            Tesk tesk3 = new Tesk();
            tesk3.NpcName = "秦始皇";
            tesk3.Workinfo = "朕最近十分忧虑，恐朕不能保我大秦万事基业，然朕听闻，蓬莱仙岛有仙丹可保我大秦万世基业，需要尔去蓬莱给朕带回，尔可明白？";
            tesk3.Speak();
            //武器npc
            Shop shop1 = new Shop("干将","双剑");
            shop1.Speak();
            //材料npc
            Shop shop2 = new Shop("小宝","龙须草");
            shop2.Speak();
            //食物npc
            Shop shop3 = new Shop("多宝道人","万寿丹");
            //修补npc
            Ironsmith ironsmith1 = new Ironsmith("火神","尊贵的雅典娜需要我为你修补宙斯之盾");
            ironsmith1.Speak();
            //强化npc
            Ironsmith i2 = new Ironsmith("火神","我能为你强化宙斯之盾");
            i2.Speak();
            //打造npc
            Ironsmith i3 = new Ironsmith("火神", "需要我为你打造那连宙斯脑袋都能敲碎的神器吗？");
            i3.Speak();
        }
    }
}
